﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace PDAServer
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IService1”。
    [ServiceContract]
    public interface IPdaService
    {
        /// <summary>
        /// 获取登录用的账套
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        Dictionary<string, string> GetCenters();

        /// <summary>
        /// 盘点
        /// </summary>
        /// <param name="composite"></param>
        /// <returns></returns>
        [OperationContract]
        KingdeeLoginParams DoStockCheck(KingdeeLoginParams composite, StockCheckData message);



        // TODO: 在此添加您的服务操作
    }


    /// <summary>
    /// 用户登录信息
    /// </summary>
    [DataContract]
    public class KingdeeLoginParams
    {

        string acctID ;
        string localId = "2052 ";

        /// <summary>
        /// 账套ID
        /// </summary>
        [DataMember]
        public string AcctID
        {
            get { return acctID; }
            set { acctID = value; }
        }

        /// <summary>
        /// 语言标识
        /// </summary>
        [DataMember]
        public string LocalId
        {
            get { return localId; }
            set { localId = value; }
        }

        [DataMember]
        public string UsernName { get; set; }


        [DataMember]
        public string PassWord { get; set; }

    }


    /// <summary>
    /// 盘点数据
    /// </summary>
    [DataContract]
    public class StockCheckData{

        /// <summary>
        /// 扫的条码
        /// </summary>
        List<string> ScanelCodes { get; set; }

        
    }

    /// <summary>
    /// 执行结果
    /// </summary>
    [DataContract]
    public class OperateResult
    {
        public bool IsSuc { get; private set; }

        public string Msg { get; private set; }

        public string ExceptionMessage { get; private set; }

        public static OperateResult Suc(string message="操作成功") {

            return new OperateResult() { IsSuc = true,Msg=message };

        }

        public static OperateResult Fail(string message,string exceptionMessage) {

            return new OperateResult() { IsSuc = false, Msg = message, ExceptionMessage=exceptionMessage };

        }


    }


}
